home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_voicelinecharger.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  135 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # PRU_voicelineCan'tWhip.cog    Plays a voice line when Indy sees something.
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  9. #
  10. # ========================================================================================
  11. symbols
  12.  
  13. message    activated
  14.  
  15. surface    surf0
  16. surface    surf1
  17. surface    surf2
  18.  
  19. thing    cam1spot
  20. thing    cam1look
  21. thing    player                    local
  22. thing    chargerTarg                local
  23. thing    chargerCam                local
  24.  
  25. sound    dialogue=inxj233.wav    local    #Hmm.  This might be important.
  26.  
  27. int        once0=0    local
  28. int        once1=0    local
  29. int        once2=0    local
  30.  
  31. flex    ponderscene                local
  32.  
  33. vector    v_modvec                local
  34. vector    v_targetpos0            local
  35. sector    targetsector            local
  36. template    ghostTpl=ghost        local
  37.  
  38. end
  39. # ========================================================================================
  40. code
  41.  
  42. activated:
  43. player = GetLocalPlayerThing();
  44.  
  45. if (GetCurWeapon(player) != 0) return;
  46.  
  47. if ((GetSenderRef() == surf0) && (once0 == 0))
  48. {
  49.     once0 = 1;
  50.     Call Ponderscene;
  51.     return;
  52. }
  53. if ((GetSenderRef() == surf1) && (once1 == 0))
  54. {
  55.     once1 = 1;
  56.     Call Ponderscene;
  57.     return;
  58. }if ((GetSenderRef() == surf2) && (once2 == 0))
  59. {
  60.     once2 = 1;
  61.     Call Ponderscene;
  62.     return;
  63. }
  64.  
  65. return;
  66. # ========================================================================================
  67. Ponderscene:
  68.  
  69. MakeMeStop();
  70. StartCutscene(1);
  71.  
  72. #create a new target out in front of Indy.
  73. v_modvec = VectorSet(0, 0.1, 0.075);
  74. v_targetpos0 = VectorAdd(VectorTransformToOrient(player, v_modvec), GetThingPos(player));    
  75. targetsector = FindNewSectorFromThing(player, v_targetpos0);
  76.  
  77. chargerTarg = CreateThingAtPos(ghostTpl, targetsector, v_targetpos0, '0 0 0');
  78.  
  79. if (GetSenderRef() != surf2)
  80. {
  81.     #create a new camera position behind Indy.
  82.     v_modvec = VectorSet(0.1, -0.1, 0.0);
  83.     v_targetpos0 = VectorAdd(VectorTransformToOrient(player, v_modvec), GetThingPos(player));    
  84.     targetsector = FindNewSectorFromThing(player, v_targetpos0);
  85. }
  86. else
  87. {
  88.     #create a new camera position behind Indy.
  89.     v_modvec = VectorSet(-0.1, -0.1, 0.0);
  90.     v_targetpos0 = VectorAdd(VectorTransformToOrient(player, v_modvec), GetThingPos(player));    
  91.     targetsector = FindNewSectorFromThing(player, v_targetpos0);
  92. }
  93.  
  94. chargerCam = CreateThingAtPos(ghostTpl, targetsector, v_targetpos0, '0 0 0');
  95.  
  96. MakeCamera2LikeCamera1(cam1spot, cam1look);
  97. SetCameraLookInterp(2, 0);             # force snap if not sure already the case
  98. SetCameraPosInterp(2, 0);             # force snap if not sure already the case
  99. SetCameraFocus(2, cam1spot);         # cam 2 takes over here
  100. SetCameraSecondaryFocus(2, cam1look); # looking same place
  101. #viewangle = GetCameraFOV();         # it pays to be careful
  102. SetCurrentCamera(2);
  103. ResetCameraFOV(0, 0.0);
  104. #SetCameraFOV(60, 1, 1.2);             # start here anyway
  105. SetCameraLookInterp(2, 1);
  106. SetCameraPosInterp(2, 1);
  107. SetCameraInterpSpeed(2, 1.2);       
  108. Sleep(0.01);                         # let engine work briefly
  109. SetCameraFocus(2, chargerCam);         # slide out to new spot
  110.  
  111. SetCameraSecondaryFocus(2, chargerTarg); # slide over to new target
  112.  
  113. PlayVoice(player, dialogue, 1, 1);
  114.  
  115. SetCameraInterpSpeed(2, 1.0); # quicker going back, please
  116. Sleep(0.01);                         # let engine work briefly
  117. SetCameraSecondaryFocus(2, cam1look);
  118. SetCameraFocus(2, cam1spot);
  119. #SetCameraFOV(viewangle, 1, 1.0); # transition back to follow-cam FOV
  120. Sleep(1.0);
  121. SetCameraLookInterp(2, 0); # exit in snap mode
  122. SetCameraPosInterp(2, 0); # exit in snap mode
  123.  
  124. #SetCameraPosition(1, cam1spot);
  125. SetCurrentCamera(1);
  126. ClearActorFlags(player, 0x200000);
  127. EndCutscene();
  128.  
  129.     
  130. return;
  131.  
  132. end
  133. # .................................................................................
  134.  
  135.